<?php
include './include/conf.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">

	<head>
		<title>Jardins familiaux de Lacroix-Falgarde : modifier compte adhérents</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
		<link rel="stylesheet" type="text/css" href="./style/style.css" />
		<script  type="text/javascript" src="./script/fonctions_communes.js"></script>
		<script  type="text/javascript" src="./script/modifier_compte_adherent.js"></script>
	</head>
	
	<body>
	<div id="global">
		<?php include './include/header.php'; ?>
		
		<div id="contenu">

				<?php 
				include './include/menu_gauche.php';
				if(isset($_GET['prenom']) && isset($_GET['nom'])){
					$tabIdentifiants[0] = $_GET['prenom'];
					$tabIdentifiants[1] = $_GET['nom'];
				}else{
					$identifiant = (isset($_SESSION["identifiant"]) && $_SESSION["identifiant"] != "temp") ? $_SESSION["identifiant"]:"";
					$tabIdentifiants = explode(".", $identifiant);
				}
				?>					
				<div id="information">
				
					<h1>Modifier compte adhérent</h1>
					
					<form id="form1" name="form1" method="post" action="modifier_adherent.php">
						
						<label class="modifier" for="nom">Nom* : </label>
						<input type="text" id="nom_personne" name="nom" readonly="readonly" value='<?php echo $tabIdentifiants[1]?>' /><br/><br/>
		
						<label class="modifier" for="prenom">Prénom* : </label>
						<input type="text" id="prenom_personne" name="prenom" readonly="readonly" value='<?php echo $tabIdentifiants[0]?>' /><br/><br/>		
													
						<label class="modifier" for="mdp">Mot de passe : </label>
						<input type="password" name="mdp" id="mdp"/><br/><br/>
						
						<label class="modifier" for="nouveau_mdp">Nouveau mot de passe : </label>
						<input id="new_mdp" type="password" name="new_mdp" id="new_mdp"/><br/><br/>
						
						<label class="modifier" for="confirmer_mdp">Confirmer mot de passe : </label>
						<input type="password" name="confirmer_mdp" id="confirmer_mdp"/><br/><br/>
						
						<label class="modifier" for="adresse">Adresse : </label>
						<input id="adresse" type="text"  name="adresse" />
						<input class="anonymat" type="checkbox" id="vis_adresse"><br/><br/>
						
						<label class="modifier" for="tel_fixe">T&eacute;l&eacute;phone fixe : </label>
						<input id="tel_fixe" type="text"  name="tel_fixe" maxlength="12"/>
						<input class="anonymat" type="checkbox" id="vis_tel_fixe"><br/><br/>
					
						
						<label class="modifier" for="tel_port">T&eacute;l&eacute;phone portable : </label>
						<input id="tel_port" type="text"  name="tel_port" maxlength="12"/>
						<input class="anonymat" type="checkbox" id="vis_tel_port"><br/><br/>
						
						<label class="modifier" for="email">Email : </label>
						<input id="email" type="text"  name="email" />
						<input class="anonymat" type="checkbox" id="vis_email"><br/><br/>
						
						<?php 
						$verif_wm = $pdo->prepare('select * from adherent where prenom = ? and nom = ?');
						$verif_wm->execute(array($tabIdentifiants[0],$tabIdentifiants[1]));
						$wm=$verif_wm->fetch();
						if($wm->est_webmaster == 1){
						?>
							<label class="modifier" for="chg_wm">Changer Webmaster :</label>
							<input id="chg_wm" type="text"  name="chg_wm" /><br/><br/>
							
						<?php }	?>
										
						<input id="bt_modifier" class="bouton_gauche" type="submit" name="bt_modifier" value="Modifier" />
						<button id="annuler">Annuler</button> 				
				</form>
				</br>
				<div id="mess_erreur"></div>
			</div>
		</div>		
	<?php include './include/footer.php' ;?>		
	</div>
	</body>
</html>